<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子5-ES6/7常用语法介绍</title>
    </head>
    <body>
        <pre>
            <code>
                // 例子5
                const PI = 3.1415926
                console.log(PI); // 3.1415926
                PI = 3; // Uncaught TypeError: Assignment to constant variable

                //-------------------------------------------------

                const MAX; // Uncaught SyntaxError: Missing initializer in const declaration
                MAX = 10;

                //-------------------------------------------------

                function fn() {
                    const MIN = 1;
                }
                console.log(MIN); // Uncaught ReferenceError: MIN is not defined

                //-------------------------------------------------

                console.log(REG); // Uncaught ReferenceError: REG is not defined
                const REG = /\d+/;
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/5.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>